﻿<controls:ChildWindow x:Class="FIFP.DashBoard.Views.AddActivityPopup"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"        
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"            
           DataContext="{Binding ImportVM, Source={StaticResource ServiceLocator}}"
           xmlns:vc="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
           Title="Add Activity" Style="{StaticResource CreateTicket}">
    <Grid x:Name="LayoutRoot" Margin="2">
        <!--<Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>-->

        <Button x:Name="CloseButton" Grid.Column="1" HorizontalAlignment="Right" Height="14" IsTabStop="False" Style="{StaticResource CloseButtonStyle}" VerticalAlignment="Top" Width="15" Cursor="Hand" Margin="0,0,-2,0">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Click">
                    <i:InvokeCommandAction
                                                    Command="{Binding CancelCommand}"
                                                    CommandParameter="{Binding ElementName=btnCancel}" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Button>
        <Grid x:Name="Popup" Margin="0,28,0,0" >
            <Border Width="450" HorizontalAlignment="Left" CornerRadius="15" BorderThickness="1">
                <Grid Margin="20,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="15"/>
                        <ColumnDefinition Width="0.5*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>

                    </Grid.RowDefinitions>
                    <!--<Button Content="X" Grid.Column="1" Margin="0" HorizontalAlignment="Right" VerticalAlignment="Top" Style="{StaticResource ButtonStyle1}"/>-->
                    <TextBlock Margin="0" Grid.Row="2" TextWrapping="Wrap" Text="Unit Type" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource PopupContent}"/>
                    <TextBlock Margin="0" Grid.Row="3" TextWrapping="Wrap" Text="Unit Name" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource PopupContent}"/>
                    <TextBlock Margin="0" Grid.Row="1" TextWrapping="Wrap" Text="Activity Code" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource PopupContent}"/>
                    <TextBlock Margin="0" Grid.Row="0" TextWrapping="Wrap" Text="Division" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource PopupContent}"/>
                    <TextBlock Margin="0" Grid.Row="4" TextWrapping="Wrap" Text="Start Date" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource PopupContent}"/>
                    <TextBlock Margin="0" Grid.Row="5" TextWrapping="Wrap" Text="End Date" VerticalAlignment="Center" HorizontalAlignment="Left" Style="{StaticResource PopupContent}"/>
                    <TextBlock Margin="0" Grid.Row="6" TextWrapping="Wrap" Text="Description" VerticalAlignment="Top" HorizontalAlignment="Left" Style="{StaticResource PopupContent}"/>
                    <ComboBox Name="cmbUnitType" Grid.Row="2" ItemsSource="{Binding UnitTypeList}" SelectedItem="{Binding SelectedUnitType,Mode=TwoWay}" IsEnabled="{Binding IsUnitTypeEnabled}" Grid.Column="2" Margin="0,2,24,2" Style="{StaticResource ComboBoxStyle}" ItemContainerStyle="{StaticResource ComboBoxItemStyle1}" Height="21">
                        <i:Interaction.Triggers>
                            <i:EventTrigger  EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding UnitTypeSelectionCommand}" 
        							CommandParameter="{Binding ElementName=cmbUnitType}"  />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </ComboBox>
                    <ComboBox ItemsSource="{Binding UnitNameList}" DisplayMemberPath="UnitName" IsEnabled="{Binding IsUnitNameEnabled}" SelectedItem="{Binding SelectedActivityUnit, Mode=TwoWay}"  Grid.Column="2" Grid.Row="3" Margin="0,2,24,2" Style="{StaticResource ComboBoxStyle}" ItemContainerStyle="{StaticResource ComboBoxItemStyle1}" Height="21" />
                    <ComboBox Name="cmbActivity" ItemsSource="{Binding ActivityCodeList}" IsEnabled="{Binding IsActivityCodeEnabled}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedActivityCode,Mode=TwoWay}" Grid.Row="1" Grid.Column="2" Margin="0,2,24,2" Style="{StaticResource ComboBoxStyle}" ItemContainerStyle="{StaticResource ComboBoxItemStyle1}" Height="21">
                        <i:Interaction.Triggers>
                            <i:EventTrigger  EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding ActivityCodeSelectionCommand}" 
        							CommandParameter="{Binding ElementName=cmbActivity}"  />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </ComboBox>
                    <ComboBox Name="cmbDivision" ItemsSource="{Binding DivisionCodeList}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedDivisionName,Mode=TwoWay}" Grid.Row="0" Grid.Column="2" Margin="0,2,24,2" Style="{StaticResource ComboBoxStyle}" ItemContainerStyle="{StaticResource ComboBoxItemStyle1}" Height="21">
                        <i:Interaction.Triggers>
                            <i:EventTrigger  EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding DivisionSelectionCommand}" 
        							CommandParameter="{Binding ElementName=cmbDivision}"  />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </ComboBox>
                    <controls:DatePicker Name="startdatePicker" Width="296" HorizontalAlignment="Left" DisplayDate="{Binding ActivityStartDate,Mode=TwoWay}" SelectedDate="{Binding ActivityStartDate,Mode=TwoWay}" Grid.Row="4" Grid.Column="2" Margin="0,2,0,2" Style="{StaticResource DatePickerStyle}"  FontFamily="Calibri" FontSize="14.667" CalendarStyle="{StaticResource CalendarStyle}" Height="24">
                        <!--<i:Interaction.Triggers>
                            <i:EventTrigger  EventName="SelectedDateChanged">
                                <i:InvokeCommandAction Command="{Binding SelectedStartDateChangedCommand}" 
        							CommandParameter="{Binding ElementName=startdatePicker}"  />
                            </i:EventTrigger>
                            <i:EventTrigger  EventName="Loaded">
                                <i:InvokeCommandAction Command="{Binding StartDateLoadedCommand}" 
        							CommandParameter="{Binding ElementName=startdatePicker}"  />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>-->
                    </controls:DatePicker>
                    <controls:DatePicker Name="endDatePicker" Width="296" HorizontalAlignment="Left" Margin="0,2" Cursor="Hand" DisplayDate="{Binding ActivityEndDate,Mode=TwoWay}" SelectedDate="{Binding ActivityEndDate,Mode=TwoWay}" Style="{StaticResource DatePickerStyle}" FontFamily="Calibri" FontSize="14.667" CalendarStyle="{StaticResource CalendarStyle}" Height="24" Grid.Column="2" Grid.Row="5">
                        <!--<i:Interaction.Triggers>
                            <i:EventTrigger  EventName="Loaded">
                                <i:InvokeCommandAction Command="{Binding EndDateLoadedCommand}" 
        							CommandParameter="{Binding ElementName=endDatePicker}"  />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>-->
                    </controls:DatePicker>
                    <TextBox Text="{Binding CommentsText, Mode=TwoWay, NotifyOnValidationError=True, UpdateSourceTrigger=Default}" MaxLength="4000" Grid.Column="2" Margin="0,2,24,0" Grid.Row="6" Style="{StaticResource TextBoxStyle1}" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" Height="80" />
                    <Grid Margin="0,0,23,0" Grid.Row="7" HorizontalAlignment="Right" Grid.Column="2" Height="35" VerticalAlignment="Bottom">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Button x:Name="btnCreate" Margin="0,10,0,0" IsEnabled="{Binding IsAddButtonEnabled}" Command="{Binding Path=AddActivityCommand}" CommandParameter="{Binding ElementName=btnCreate}"  Width="95" Style="{StaticResource ButtonStyle}" Cursor="Hand">
                            <Grid Margin="9,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="0.827*"/>
                                </Grid.ColumnDefinitions>
                                <Image HorizontalAlignment="Right" Height="16" Margin="0,0,8,0" Source="/FIFP.DashBoard;component/Images/accept.png" Stretch="Fill" VerticalAlignment="Center" Width="19"/>
                                <TextBlock Grid.Column="1" HorizontalAlignment="Center" Margin="0" TextWrapping="Wrap" Text="Add" VerticalAlignment="Center"/>
                            </Grid>
                        </Button>
                        <Button x:Name="btnCancel" Grid.Column="1" Margin="10,10,0,0" Command="{Binding Path=CancelCommand}" CommandParameter="{Binding ElementName=btnCancel}" Style="{StaticResource ButtonStyle}" Width="95" Cursor="Hand">
                            <Grid Margin="9,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="0.827*"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.Column="1" HorizontalAlignment="Center" Margin="0" TextWrapping="Wrap" Text="Cancel" VerticalAlignment="Center"/>
                                <Image HorizontalAlignment="Right" Height="15" Margin="0,0,8,0" Source="/FIFP.DashBoard;component/Images/Dismiss.png" Stretch="Fill" VerticalAlignment="Center" Width="16"/>
                            </Grid>
                        </Button>
                    </Grid>
                    <vc:ValidationSummary Grid.Row="8" Grid.ColumnSpan="3" VerticalAlignment="Top" Width="Auto" Height="Auto" MaxHeight="93" Margin="0,10,24,0" Foreground="Black" Style="{StaticResource ValidationSummaryStyle1}" Background="{x:Null}" BorderBrush="{x:Null}"/>
                </Grid>
            </Border>
        </Grid>
    </Grid>
</controls:ChildWindow>